using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Enemy : MonoBehaviour
{
    // Start is called before the first frame update
    protected Animator Anim;

    protected AudioSource DeathAudio;
    protected virtual void Start()
    {
        Anim = gameObject.GetComponent<Animator>();
        DeathAudio = gameObject.GetComponent<AudioSource>();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Death(){
      GetComponent<Collider2D>().enabled = false;
      Destroy(gameObject);
    }

    public void JumpOn(){
      DeathAudio.Play();
      Anim.SetTrigger("death");
    }
}
